package com.lxh.student.service.impl;

import com.lxh.student.entity.ResponseResult;
import com.lxh.student.entity.Teacher;
import com.lxh.student.mapper.TeacherMapper;
import com.lxh.student.service.TeacherService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service;

@Service
@Primary
@Slf4j
public class TeacherServiceImpl implements TeacherService {

    @Autowired
    private TeacherMapper teacherMapper;

    @Override
    public ResponseResult findOne(Teacher teacher) {
        log.info("查询数据库了！");
        return  new ResponseResult(200,"登陆成功！",teacherMapper.findOne(teacher));
    }

    @Override
    public Teacher findOne(String username) {
        return teacherMapper.findOneByName(username);
    }

    @Override
    public ResponseResult logout() {
        return null;
    }
}
